/* Copyrights Security Engineering Research Group 
 * Author: Nauman (http://recluze.wordpress.com) 
 * 
 */

package edu.serg.mbar.ucon.meta;

import java.util.HashMap;
import java.util.Map;
import java.util.Set;
import java.util.Vector;

/**
 * This class stores attribute information It doesn't store a subject id because
 * it is used as the value for key "subject id" from {@link SubjectInfo}.
 * 
 * 
 * @author Nauman (recluze.wordpress.com)
 * 
 */
public class AttributeCollection {

	/** The Map containing the attributes */
	private Map<String, Vector<String>> attributesMap;

	public AttributeCollection() {
		attributesMap = new HashMap<String, Vector<String>>();
	}

	/**
	 * Add an attribute name/values pair to attributes
	 * 
	 * @param attribName
	 *            Name of the attribute
	 * @param attribVals
	 *            Vector of attribute values
	 */
	public void addAttribute(String attribName, Vector<String> attribVals) {
		attributesMap.put(attribName, attribVals);
	}

	/**
	 * Return the value of an attribute
	 * 
	 * @param attribName
	 *            Name of the attribute
	 * @return The values of the attribute
	 */
	public Vector<String> getAttribute(String attribName) {
		return attributesMap.get(attribName);
	}

	/**
	 * Retrieve a {@link Set} of all attribute names
	 * 
	 * @return Set containing all attribute names.
	 */
	public Set<String> getAttributeNames() {
		return attributesMap.keySet();
	}

}
